<h1 mat-dialog-title>修改 {{actionDetail.name}}, ID={{actionDetail.actionId}}</h1>
<div mat-dialog-content style="overflow: unset;">
    <form #actionForm="ngForm">
        <mat-form-field class="insert-full-width">
            <input matInput type="text" [(ngModel)]="actionDetail.name" name="name" placeholder="名稱" required>
        </mat-form-field>

        <mat-form-field class="insert-full-width">
            <mat-select [(ngModel)]="actionDetail.method" name="method" [compareWith]="compareObjects"
                placeholder="隸屬選單">
                <mat-option *ngFor="let Method of methodList" value="{{Method}}">{{Method}}</mat-option>
            </mat-select>
        </mat-form-field>

        <mat-form-field class="insert-full-width">
            <input matInput type="text" [(ngModel)]="actionDetail.controllerId" name="controllerId" placeholder="控制器"
                required>
        </mat-form-field>

        <mat-form-field class="insert-full-width">
            <input matInput #inputDes type="text" maxlength="20" [(ngModel)]="actionDetail.description"
                name="description" placeholder="描述">
            <mat-hint align="end">{{inputDes.value?.length || 0}}/20</mat-hint>
        </mat-form-field>
    </form>
</div>
<div mat-dialog-actions>
    <button mat-raised-button color="primary" (click)="onNoClick()">No</button>
    <button mat-raised-button color="primary" [disabled]="!actionForm.valid" (click)="onYesClick()">Yes</button>
</div>